home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / AppleScanGS / Scan.r < prev    next >
Encoding:
Text File  |  1990-12-03  |  18.5 KB  |  934 lines  |  [TEXT/MPS ]

  1. /*---------------------------------------------------------------*/
  2.  
  3. #include "TypesIIGS.r" 
  4. #include "ScannerDefs.h"    /* tricky, tricky! */
  5.  
  6. /*------------------- Values used through out -------------------*/
  7.  
  8. #define    LELine1        20
  9. #define LELeft1        10
  10. #define LEHeight    15
  11. #define    LEWidth        80
  12. #define TopOfRow4    90
  13. #define LeftEdge3    100
  14. #define    BottomOfRow4 110
  15. #define    RightEdge3    130
  16.  
  17. #define disabled    $80
  18.  
  19. #ifndef fUseShadowing
  20. #define fUseShadowing    $8000
  21. #define fFastPortAware    $4000
  22. #endif
  23.  
  24. /*----------------------- About Box ------------------------------*/
  25. resource rAlertString (AboutBox) {
  26.     "\$00\$19\$00\$0A\$00\$AA\$00\$35\$01"
  27.     "\$00/"
  28.     TBCenterJust
  29.     TBStyleOutline
  30.     "AppleScan.GS"
  31.     TBEndOfLine
  32.     TBEndOfLine
  33.     TBStylePlain
  34.     "A Program to digitize images using the Apple Scanner."
  35.     TBEndOfLine
  36.     TBEndOfLine
  37.     "by"
  38.     TBEndOfLine
  39.     "The Apple ]["
  40.     TBEndOfLine
  41.     "System Software Group"
  42.     TBEndOfLine
  43.     TBEndOfLine
  44.     "© 1990, Apple Computer, Inc."
  45.     TBEndOfLine
  46.     "All Rights Reserved"
  47.     TBEndOfLine
  48.     "Version 1.0d1/^#6\$00"
  49. };
  50.  
  51. /*----------------------- Unable to allocate handle ------------------------------*/
  52. resource rAlertString (noMemAvailable) {
  53.     "20|Unable to allocate Handle.|^#0"
  54. };
  55.  
  56. /*----------------- no scanner device found in device list ------------------------*/
  57. resource rAlertString (noScannerFound) {
  58.     "83|AppleScan.GS is unable to find a scanner.  "
  59.     "Please check the power and SCSI connections, and "
  60.     "make sure you have the scanner driver file installed "
  61.     "in your system folder."
  62.     TBEndOfLine
  63.     TBEndOfLine
  64.     "If you continue, you can work with documents, but "
  65.     "you will not be able to scan."
  66.     TBEndOfLine
  67.     "|^#5|#6\$00"
  68. };
  69.  
  70. /*----------------------- Unable to allocate handle ------------------------------*/
  71. resource rAlertString (scannerNotReady) {
  72.     "83|Your scanner is not ready to be used.  Please "
  73.     "make sure it's turned on and warmed up, then "
  74.     "click on the \"Try Again\" button."
  75.     TBEndOfLine
  76.     TBEndOfLine
  77.     "If you \"Continue\", you can work with documents, but "
  78.     "you will not be able to scan."
  79.     TBEndOfLine
  80.     "|^#5|#4|#6\$00"
  81. };
  82.  
  83. /*----------------------Startup Record ---------------------------*/
  84. resource rToolStartup (1) {
  85.     fUseShadowing + fFastPortAware, /* master SCB, mode 320 */
  86.     { 
  87.         3,$0100, /* misc tools */
  88.         4,$0100, /* quickdraw */
  89.         5,$0100, /* desk manager */
  90.         6,$0100, /* eventMgr */
  91.         /* 7,$0100, /* scheduler */
  92.         /* 8,$0100, /* sound tools */
  93.         /* 9,$0100, /* ADB tools */
  94.         /* 10,$0100, /* SANE */
  95.         11,$0100, /* int math */
  96.         14,$0300, /* Window Manager */
  97.         15,$0300, /* Menu Manager */
  98.         16,$0300, /* Control Manager */
  99.         18,$0200, /* QD Aux */
  100.         19,$0100, /* print manager */
  101.         20,$0100, /* LineEdit tool set */
  102.         21,$0100, /* Dialog Manager */
  103.         22,$0100, /* Scrap manager */
  104.         23,$0100, /* standard file */
  105.         27,$0100, /* Font manager */
  106.         28,$0100, /* list manager */
  107.         34,$0100, /* text edit */
  108.         /* 29,$0100, /* ACE */
  109.         /* 32,$0100, /* Midi Tools */
  110.         /* 25,$0100, /* NoteSynth */
  111.         /* 26,$0100 /* Note Seq */
  112.     }
  113. };
  114.  
  115.  
  116. /*********************************************************************/
  117. /*
  118. /* Menus
  119. /*
  120. /*********************************************************************/
  121.  
  122. resource rMenuBar (1) {
  123.     {
  124.         AppleMenuID,
  125.         FileMenuID,
  126.         EditMenuID,
  127.         ScanMenuID,
  128.     };
  129. };
  130.  
  131. resource rMenu (ScanMenuID) {
  132.     ScanMenuID,
  133.     0xA008,
  134.     ScanMenuID,
  135.     {
  136.         SettingsID,
  137.         PreviewID
  138.     };
  139. };
  140.  
  141. resource rMenu (AppleMenuID) {
  142.     AppleMenuID,
  143.     0xA008,
  144.     AppleMenuID,
  145.     {
  146.         AboutID
  147.     };
  148. };
  149.  
  150. resource rMenu (FileMenuID) {
  151.     FileMenuID,
  152.     0xA008,
  153.     FileMenuID,
  154.     {
  155.         OpenID,
  156.         SaveID,
  157.         SaveAsID,
  158.         PrefID,
  159.         PrintID,
  160.         CloseID,
  161.         QuitID
  162.     };
  163. };
  164.  
  165. resource rMenu (EditMenuID) {
  166.     EditMenuID,
  167.     0xA088,
  168.     EditMenuID,
  169.     { 
  170.         UndoID,
  171.         CutID,
  172.         CopyID,
  173.         PasteID,
  174.         ClearID 
  175.     };
  176. };
  177.  
  178. resource rMenuItem (PreviewID) {
  179.     PreviewID,
  180.     "","",    //"T","t",
  181.     0,
  182.     0x8000,
  183.     PreviewID
  184. };
  185.  
  186. resource rMenuItem (SettingsID) {
  187.     SettingsID,
  188.     "","",
  189.     0,
  190.     0x8000,
  191.     SettingsID
  192. };
  193.  
  194. resource rMenuItem (AboutID) {
  195.     AboutID,
  196.     "","",
  197.     0,
  198.     0x8040,
  199.     AboutID
  200. };
  201.  
  202. resource rMenuItem (UndoID) {
  203.     UndoID,
  204.     "Z","z",
  205.     0,
  206.     0x8080,
  207.     UndoID
  208. };
  209.  
  210. resource rMenuItem (CutID) {
  211.     CutID,
  212.     "X","x",
  213.     0,
  214.     0x8080,
  215.     CutID
  216. };
  217.  
  218. resource rMenuItem (CopyID) {
  219.     CopyID,
  220.     "C","c",
  221.     0,
  222.     0x8080,
  223.     CopyID
  224. };
  225.  
  226. resource rMenuItem (PasteID) {
  227.     PasteID,
  228.     "V","v",
  229.     0,
  230.     0x8080,
  231.     PasteID
  232. };
  233.  
  234. resource rMenuItem (ClearID) {
  235.     ClearID,
  236.     "","",
  237.     0,
  238.     0x8080,
  239.     ClearID
  240. };
  241.  
  242. resource rMenuItem (CloseID) {
  243.     CloseID,
  244.     "W","w",
  245.     0,
  246.     0x8000+disabled,
  247.     CloseID
  248. };
  249.  
  250. resource rMenuItem (QuitID) {
  251.     QuitID,
  252.     "Q","q",
  253.     0,
  254.     0x8000,
  255.     QuitID
  256. };
  257.  
  258. resource rMenuItem (OpenID) {
  259.     OpenID,
  260.     "O","o",
  261.     0,
  262.     0x8000+disabled,
  263.     OpenID
  264. };
  265.  
  266. resource rMenuItem (SaveID) {
  267.     SaveID,
  268.     "S","s",
  269.     0,
  270.     0x8000+disabled,
  271.     SaveID
  272. };
  273.  
  274. resource rMenuItem (SaveAsID) {
  275.     SaveAsID,
  276.     "","",
  277.     0,
  278.     0x8000+disabled,
  279.     SaveAsID
  280. };
  281.  
  282. resource rMenuItem (PrefID) {
  283.     PrefID,
  284.     "","",
  285.     0,
  286.     0x8000+disabled,
  287.     PrefID
  288. };
  289.  
  290. resource rMenuItem (PrintID) {
  291.     PrintID,
  292.     "P","p",
  293.     0,
  294.     0x8000+disabled,
  295.     PrintID
  296. };
  297.  
  298. resource rPString (AppleMenuID) {
  299.     "@"
  300. };
  301.  
  302. resource rPString (FileMenuID) {
  303.     " File "
  304. };
  305.  
  306. resource rPString (EditMenuID) {
  307.     " Edit "
  308. };
  309.  
  310. resource rPString (ScanMenuID) {
  311.     " Scan "
  312. }; 
  313.  
  314. resource rPString (AboutID) {
  315.     "About AppleScan.GS…"
  316. };
  317.  
  318. resource rPString (CloseID) {
  319.     "Close"
  320. };
  321.  
  322. resource rPString (UndoID) {
  323.     "Undo"
  324. };
  325.  
  326. resource rPString (CutID) {
  327.     "Cut"
  328. };
  329.  
  330. resource rPString (CopyID) {
  331.     "Copy"
  332. };
  333.  
  334. resource rPString (PasteID) {
  335.     "Paste"
  336. };
  337.  
  338. resource rPString (ClearID) {
  339.     "Clear"
  340. };
  341.  
  342. resource rPString (QuitID) {
  343.     "Quit"
  344. };
  345.  
  346. resource rPString (PreviewID) {
  347.     "Preview"
  348. };
  349.  
  350. resource rPString (OpenID) {
  351.     "Open"
  352. };
  353.  
  354. resource rPString (SaveID) {
  355.     "Save"
  356. };
  357.  
  358. resource rPString (SaveAsID) {
  359.     "Save As…"
  360. };
  361.  
  362. resource rPString (PrefID) {
  363.     "Preferences…"
  364. };
  365.  
  366. resource rPString (PrintID) {
  367.     "Print"
  368. };
  369.  
  370. resource rPString (SettingsID) {
  371.     "Settings…"
  372. };
  373.  
  374.  
  375. /*---------------------------------------------------------------------------*/
  376. /*
  377. /* ImageWindow…
  378. /*
  379. /*---------------------------------------------------------------------------*/
  380.  
  381. resource rWindParam1 (ImageWindow) {
  382.     fTitle+fMove+fZoom+fGrow+fBScroll+fRScroll+fClose+fVis,    /* Frame Bits */
  383.     ImageWindow,                                             /* title ID */
  384.     0,                                                        /* ref Con */
  385.     {0,0,0,0},                                                /* Zoom Rect */
  386.     ImageWindow,                                            /* color table id */
  387.     {0,0},                                                    /* origin */
  388.     {400,640},                                                /* data size */
  389.     {200,640},                                                /* max height-width */
  390.     {2,2},                                                    /* scroll amount, hor,ver */
  391.     {60,200},                                                /* page amount */
  392.     0,                                                        /* wInfo Ref Con */
  393.     0,                                                        /* wInfo height */
  394.     {50,50,120,260},                                        /* window Position */
  395.     infront,                                                /* wPlane */
  396.     0,                                                        /* Control Ref */
  397.     (refIsResource<<8) +                                    /* descriptor for title */
  398.     (refIsResource<<10)                                        /* descriptor for color table */
  399. };
  400.  
  401. resource rpString (ImageWindow) {
  402.     "Image Window"
  403. };
  404.  
  405. resource rWindColor (ImageWindow) {
  406.     $0000,                /* frameColor */
  407.     $0f00,                /* titleColor */
  408.     $020f,                /* tBarColor */
  409.     $00f0,                /* growColor */
  410.     $0000                /* infoColor (not used, for now) */
  411. };
  412.  
  413. //---------------------------------------------------------------------------
  414. //
  415. // Thermometer Window
  416. //
  417. //---------------------------------------------------------------------------
  418.  
  419. resource rWindParam1 (ThermWindow) {
  420.     fAlert+fVis,            /* Frame Bits */
  421.     NIL,                    /* title ID */
  422.     NIL,                    /* ref Con */
  423.     {0,0,0,0},                /* Zoom Rect */
  424.     NIL,                    /* color table id */
  425.     {0,0},                    /* origin */
  426.     {0,0},                    /* data size */
  427.     {0,0},                    /* max height-width */
  428.     {0,0},                    /* scroll amount, hor,ver */
  429.     {0,0},                    /* page amount */
  430.     NIL,                    /* wInfo Ref Con */
  431.     NIL,                    /* wInfo height */
  432.     {30,40,99,279},            /* window Position */
  433.     infront,                /* wPlane */
  434.     NIL,                    /* controlList */
  435.     refIsResource*0x0100    /* descriptor */
  436. };
  437.  
  438.  
  439. /*---------------------------------------------------------------------------*/
  440. /*
  441. /* PreviewWindow…
  442. /*
  443. /*---------------------------------------------------------------------------*/
  444.  
  445. resource rWindParam1 (PreviewWindow) {
  446.     fTitle+fMove+fVis+fClose,            /* Frame Bits */
  447.     PreviewWindow,                        /* title ID */
  448.     0,                                    /* ref Con */
  449.     {0,0,0,0},                            /* Zoom Rect */
  450.     0,                                    /* color table id */
  451.     {0,0},                                /* origin */
  452.     {79,103},                            /* data size */
  453.     {79,103},                            /* max height-width */
  454.     {0,0},                                /* scroll amount, hor,ver */
  455.     {0,0},                                /* page amount */
  456.     0,                                    /* wInfo Ref Con */
  457.     0,                                    /* wInfo height */
  458.     {27,2,198,186},                        /* window Position */
  459.     infront,                            /* wPlane */
  460.     PreviewWindow,                        /* Control Ref */
  461.     refIsResource*0x0100+resourceToResource /* descriptor */
  462. };
  463.  
  464. resource rpString (PreviewWindow) {
  465.     "Preview"
  466. };
  467.  
  468. resource rControlList (PreviewWindow) {
  469.     {
  470.         0
  471.     };
  472. };
  473.  
  474.  
  475. /*---------------------------------------------------------------------------*/
  476. /*
  477. /* SettingsWindow…
  478. /*
  479. /* The Settings window 
  480. /*
  481. /*---------------------------------------------------------------------------*/
  482.  
  483. #define    ObjectOffset        (21)
  484. #define    windowHeight        (4*ObjectOffset)+10    // leave a little slop
  485. #define windowWidth            (316)
  486.  
  487. #define windowBorderSize    ((320-windowWidth-2 /* for border */) / 2)
  488.  
  489. #define windowTop            (13 /* menu bar height */ + 13 /* window title bar height */ + windowBorderSize)
  490. #define    windowLeft            (windowBorderSize+1)
  491. #define    windowBottom        ((4*ObjectOffset)+10+windowTop)
  492. #define    windowRight            (320-windowLeft)
  493.  
  494. #define LeftInset            (2)
  495. #define RightInset            (196+2)        // 196 = window field separation point
  496.  
  497. #define scanButtonWidth        (68)
  498. #define previewButtonWidth    (85)
  499. #define freeFieldWidth        ((windowWidth-previewButtonWidth-scanButtonWidth)/3)
  500.  
  501. #define    scrollHeight        (11)
  502.  
  503. resource rWindParam1 (SettingsWindow) {
  504.     fTitle+fMove+fVis+fClose,    /* Frame Bits */
  505.     SettingsWindow,                /* title ID */
  506.     0,                            /* ref Con */
  507.     {0,0,0,0},                    /* Zoom Rect */
  508.     0,                            /* color table id */
  509.     {0,0},                        /* origin */
  510.     {400,640},                    /* data size */
  511.     {200,640},                    /* max height-width */
  512.     {1,1},                        /* scroll amount, hor,ver */
  513.     {10,10},                    /* page amount */
  514.     0,                            /* wInfo Ref Con */
  515.     0,                            /* wInfo height */
  516.     {windowTop,windowLeft,windowBottom,windowRight}, /* window Position */
  517.     infront,                    /* wPlane */
  518.     SettingsWindow,                /* Control Ref */
  519.     refIsResource*0x0100+resourceToResource /* descriptor */
  520. };
  521.  
  522. resource rpString (SettingsWindow) {
  523.     "Settings"
  524. };
  525.  
  526. resource rControlList (SettingsWindow) {
  527.     {
  528.         CompositionPopUp,
  529.         XResolutionPopUp,
  530.         YResolutionPopUp,
  531.         BrightnessScroll,
  532.         BrightnessStatText,
  533.         ContrastScroll,
  534.         ContrastStatText,
  535.         ThresholdScroll,
  536.         ThresholdStatText,
  537.         ScanButton,
  538.         PreviewButton,
  539.         0
  540.     };
  541. };
  542.  
  543.  
  544. /*------ Image Composition ------*/
  545.  
  546. resource rControlTemplate (CompositionPopUp) {
  547.     CompositionPopUp,                /* control ID */
  548.     {1,LeftInset,0,0},                /* control rectangle */
  549.     PopUpControl{{                    /* control type */
  550.         0,                            /* flags */
  551.         fctlProcNotPtr+RefIsResource, /* MoreFlags */
  552.         0,                            /* RefCon */
  553.         0,                            /* Title Width */
  554.         CompositionPopUp,            /* Menu ref */
  555.         3                            /* Initial Value */
  556.     }}
  557. };
  558.  
  559. resource rMenu (CompositionPopUp) {
  560.     CompositionPopUp,                /* id of menu */
  561.     RefIsResource*MenuTitleRefShift+RefIsResource*ItemRefShift+fAllowCache, /* menu flags */
  562.     CompositionPopUp,                /* id of title string */
  563.     {    /* id's of items */
  564.         CompositionPopUpItem1,
  565.         CompositionPopUpItem2,
  566.         CompositionPopUpItem3
  567.     };
  568. };
  569.  
  570. resource rPString (CompositionPopUp) {
  571.     "Composition: "
  572. };
  573.  
  574. resource rMenuItem (CompositionPopUpItem1) {
  575.     1,
  576.     "","",
  577.     0,
  578.     0x8000,
  579.     CompositionPopUpItem1
  580. };
  581.  
  582. resource rMenuItem (CompositionPopUpItem2) {
  583.     2,
  584.     "","",
  585.     0,
  586.     0x8000,
  587.     CompositionPopUpItem2
  588. };
  589.  
  590. resource rMenuItem (CompositionPopUpItem3) {
  591.     3,
  592.     "","",
  593.     0,
  594.     0x8000,
  595.     CompositionPopUpItem3
  596. };
  597.  
  598. resource rPString (CompositionPopUpItem1) {
  599.     "Line Art"
  600. };
  601.  
  602. resource rPString (CompositionPopUpItem2) {
  603.     "Halftone"
  604. };
  605.  
  606. resource rPString (CompositionPopUpItem3) {
  607.     "Greyscale"
  608. };
  609.  
  610.  
  611. /*------ XResolutionPopUp ------*/
  612.  
  613. resource rControlTemplate (XResolutionPopUp) {
  614.     XResolutionPopUp,                /* control ID */
  615.     {(1*ObjectOffset)+1,LeftInset,0,0},    /* control rectangle */
  616.     PopUpControl{{                    /* control type */
  617.         0,                            /* flags */
  618.         fctlProcNotPtr+RefIsResource, /* MoreFlags */
  619.         0,                            /* RefCon */
  620.         0,                            /* Title Width */
  621.         XResolutionPopUp,            /* Menu ref */
  622.         1                            /* Initial Value */
  623.     }}
  624. };
  625.  
  626. resource rMenu (XResolutionPopUp) {
  627.     XResolutionPopUp,                /* id of menu */
  628.     RefIsResource*MenuTitleRefShift+RefIsResource*ItemRefShift+fAllowCache, /* menu flags */
  629.     XResolutionPopUp,                /* id of title string */
  630.     {    /* id's of items */
  631.         XResolutionPopUpItem1,
  632.         XResolutionPopUpItem2,
  633.         XResolutionPopUpItem3,
  634.         XResolutionPopUpItem4,
  635.         XResolutionPopUpItem5
  636.     };
  637. };
  638.  
  639. resource rPString (XResolutionPopUp) {
  640.     "X Resolution: "
  641. };
  642.  
  643. resource rMenuItem (XResolutionPopUpItem1) {
  644.     1,
  645.     "","",
  646.     0,
  647.     0x8000,
  648.     XResolutionPopUpItem1
  649. };
  650.  
  651. resource rMenuItem (XResolutionPopUpItem2) {
  652.     2,
  653.     "","",
  654.     0,
  655.     0x8000,
  656.     XResolutionPopUpItem2
  657. };
  658.  
  659. resource rMenuItem (XResolutionPopUpItem3) {
  660.     3,
  661.     "","",
  662.     0,
  663.     0x8000,
  664.     XResolutionPopUpItem3
  665. };
  666.  
  667. resource rMenuItem (XResolutionPopUpItem4) {
  668.     4,
  669.     "","",
  670.     0,
  671.     0x8000,
  672.     XResolutionPopUpItem4
  673. };
  674.  
  675. resource rMenuItem (XResolutionPopUpItem5) {
  676.     5,
  677.     "","",
  678.     0,
  679.     0x8000,
  680.     XResolutionPopUpItem5
  681. };
  682.  
  683. resource rPString (XResolutionPopUpItem1) {
  684.     "75 dpi"
  685. };
  686.  
  687. resource rPString (XResolutionPopUpItem2) {
  688.     "100 dpi"
  689. };
  690.  
  691. resource rPString (XResolutionPopUpItem3) {
  692.     "150 dpi"
  693. };
  694.  
  695. resource rPString (XResolutionPopUpItem4) {
  696.     "200 dpi"
  697. };
  698.  
  699. resource rPString (XResolutionPopUpItem5) {
  700.     "300 dpi"
  701. };
  702.  
  703. /*------ YResolutionPopUp ------*/
  704.  
  705. resource rControlTemplate (YResolutionPopUp) {
  706.     YResolutionPopUp,                /* control ID */
  707.     {(2*ObjectOffset)+1,LeftInset,0,0},    /* control rectangle */
  708.     PopUpControl{{                    /* control type */
  709.         0,                            /* flags */
  710.         fctlProcNotPtr+RefIsResource, /* MoreFlags */
  711.         0,                            /* RefCon */
  712.         0,                            /* Title Width */
  713.         YResolutionPopUp,            /* Menu ref */
  714.         1                            /* Initial Value */
  715.     }}
  716. };
  717.  
  718. resource rMenu (YResolutionPopUp) {
  719.     YResolutionPopUp,                /* id of menu */
  720.     RefIsResource*MenuTitleRefShift+RefIsResource*ItemRefShift+fAllowCache, /* menu flags */
  721.     YResolutionPopUp,                /* id of title string */
  722.     {    /* id's of items */
  723.         YResolutionPopUpItem1,
  724.         YResolutionPopUpItem2,
  725.         YResolutionPopUpItem3,
  726.         YResolutionPopUpItem4,
  727.         YResolutionPopUpItem5
  728.     };
  729. };
  730.  
  731. resource rPString (YResolutionPopUp) {
  732.     "Y Resolution: "
  733. };
  734.  
  735. resource rMenuItem (YResolutionPopUpItem1) {
  736.     1,
  737.     "","",
  738.     0,
  739.     0x8000,
  740.     YResolutionPopUpItem1
  741. };
  742.  
  743. resource rMenuItem (YResolutionPopUpItem2) {
  744.     2,
  745.     "","",
  746.     0,
  747.     0x8000,
  748.     YResolutionPopUpItem2
  749. };
  750. resource rMenuItem (YResolutionPopUpItem3) {
  751.     3,
  752.     "","",
  753.     0,
  754.     0x8000,
  755.     YResolutionPopUpItem3
  756. };
  757. resource rMenuItem (YResolutionPopUpItem4) {
  758.     4,
  759.     "","",
  760.     0,
  761.     0x8000,
  762.     YResolutionPopUpItem4
  763. };
  764. resource rMenuItem (YResolutionPopUpItem5) {
  765.     5,
  766.     "","",
  767.     0,
  768.     0x8000,
  769.     YResolutionPopUpItem5
  770. };
  771.  
  772.  
  773. resource rPString (YResolutionPopUpItem1) {
  774.     "75 dpi"
  775. };
  776.  
  777. resource rPString (YResolutionPopUpItem2) {
  778.     "100 dpi"
  779. };
  780.  
  781. resource rPString (YResolutionPopUpItem3) {
  782.     "150 dpi"
  783. };
  784.  
  785. resource rPString (YResolutionPopUpItem4) {
  786.     "200 dpi"
  787. };
  788.  
  789. resource rPString (YResolutionPopUpItem5) {
  790.     "300 dpi"
  791. };
  792.  
  793.  
  794.  
  795. /*------ Preview Button ------*/
  796.  
  797. resource rControlTemplate (PreviewButton) {
  798.     PreviewButton,                        /* control ID */
  799.     {3*ObjectOffset+10,freeFieldWidth,0,0},    /* control rect */
  800.     SimpleButtonControl{{                /* control type */
  801.         NormalButton,                    /* flag */
  802.         0x3002,                            /* more flags */
  803.         0,                                /* ref con */
  804.         PreviewButton,                    /* title ref */
  805.         0
  806.     }}
  807. };
  808.  
  809. resource rpString (PreviewButton) {
  810.     "Preview"
  811. };
  812.  
  813.  
  814. /*------ Brightness Scroll Bar ------*/
  815.  
  816. #define    horScroll    $0010
  817. #define rightFlag    $0008
  818. #define leftFlag    $0004
  819.  
  820. resource rControlTemplate (BrightnessScroll) {
  821.     BrightnessScroll,                        /* control ID */
  822.     {(0*ObjectOffset)+1,RightInset,(0*ObjectOffset)+1+scrollHeight,windowWidth-2},    /* control rect */
  823.     scrollControl{{                            /* control type */
  824.         horScroll+rightFlag+leftFlag,        /* flag */
  825.         FctlProcNotPtr,                        /* more flags */
  826.         0,                                    /* ref con */
  827.         256,                                /* max size */
  828.         1,                                    /* view size */
  829.         128                                    /* initial value */
  830.     }}
  831. };
  832.  
  833. resource rControlTemplate (BrightnessStatText) {
  834.     BrightnessStatText,                    /* control ID */
  835.     {(0*ObjectOffset)+1+11,RightInset,(0*ObjectOffset)+21,windowWidth-2},    /* control rect */
  836.     StatTextControl{{                    /* control type */
  837.         0,                                /* flags */
  838.         FctlProcNotPtr+RefIsResource,    /* more flags */
  839.         0,                                /* refcon */
  840.         BrightnessStatText,                /* textRef */
  841.         0,                                /* textSize */
  842.         1                                /* justification (centered) */
  843.     }}
  844. };
  845.  
  846. resource rTextForLETextBox2 (BrightnessStatText) {
  847.     "Brightness"
  848. };
  849.  
  850.  
  851. /*------ Contrast Scroll Bar ------*/
  852.  
  853. resource rControlTemplate (ContrastScroll) {
  854.     ContrastScroll,                        /* control ID */
  855.     {(1*ObjectOffset)+1,RightInset,(1*ObjectOffset)+1+scrollHeight,windowWidth-2},    /* control rect */
  856.     scrollControl{{                        /* control type */
  857.         horScroll+rightFlag+leftFlag,    /* flag */
  858.         FctlProcNotPtr,                    /* more flags */
  859.         0,                                /* ref con */
  860.         256,                            /* max size */
  861.         1,                                /* view size */
  862.         128                                /* initial value */
  863.     }}
  864. };
  865.  
  866. resource rControlTemplate (ContrastStatText) {
  867.     ContrastStatText,                    /* control ID */
  868.     {(1*ObjectOffset)+1+11,RightInset,(1*ObjectOffset)+21,windowWidth-2},    /* control rect */
  869.     StatTextControl{{                    /* control type */
  870.         0,                                /* flags */
  871.         FctlProcNotPtr+RefIsResource,    /* more flags */
  872.         0,                                /* refcon */
  873.         ContrastStatText,                /* textRef */
  874.         0,                                /* textSize */
  875.         1                                /* justification (centered) */
  876.     }}
  877. };
  878.  
  879. resource rTextForLETextBox2 (ContrastStatText) {
  880.     "Contrast"
  881. };
  882.  
  883.         
  884. /*------ Threshold Scroll Bar ------*/
  885.  
  886. resource rControlTemplate (ThresholdScroll) {
  887.     ThresholdScroll,                    /* control ID */
  888.     {(2*ObjectOffset)+1,RightInset,(2*ObjectOffset)+1+scrollHeight,windowWidth-2},    /* control rect */
  889.     scrollControl{{                        /* control type */
  890.         horScroll+rightFlag+leftFlag,    /* flag */
  891.         FctlProcNotPtr,                    /* more flags */
  892.         0,                                /* ref con */
  893.         256,                            /* max size */
  894.         1,                                /* view size */
  895.         128                                /* initial value */
  896.     }}
  897. };
  898.  
  899. resource rControlTemplate (ThresholdStatText) {
  900.     ThresholdStatText,                    /* control ID */
  901.     {(2*ObjectOffset)+1+11,RightInset,(2*ObjectOffset)+21,windowWidth-2},    /* control rect */
  902.     StatTextControl{{                    /* control type */
  903.         0,                                /* flags */
  904.         FctlProcNotPtr+RefIsResource,    /* more flags */
  905.         0,                                /* refcon */
  906.         ThresholdStatText,                /* textRef */
  907.         0,                                /* textSize */
  908.         1                                /* justification (centered) */
  909.     }}
  910. };
  911.  
  912. resource rTextForLETextBox2 (ThresholdStatText) {
  913.     "Threshold"
  914. };
  915.  
  916.  
  917. /*------ Scan Button ------*/
  918. resource rControlTemplate (ScanButton) {
  919.     ScanButton,                            /* control ID */
  920.     {3*ObjectOffset+10,windowWidth-freeFieldWidth-scanButtonWidth,0,0},    /* control rect */
  921.     SimpleButtonControl{{                /* control type */
  922.         DefaultButton,                    /* flag */
  923.         0x3002,                            /* more flags */
  924.         0,                                /* ref con */
  925.         ScanButton,                        /* title ref */
  926.         0,                                /* color table ref */
  927.         {"\n","\n",0,0}                    /* key equivalents (return and enter) */
  928.     }}
  929. }; 
  930.  
  931. resource rpString (ScanButton) {
  932.     "Scan"
  933. };
  934.